package com.net.xpay.core.domain;

import com.net.common.domain.VersionedDomain;
import com.net.xpay.core.enums.AccountBillType;
import com.net.xpay.core.enums.AccountFundType;
import com.net.xpay.core.enums.BillPayMethod;
import com.net.xpay.core.enums.PayStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * @author  on 17/03/2018.
 */
@Getter
@Setter
@NoArgsConstructor
public class AccountDetail extends VersionedDomain {
    @ApiModelProperty(notes = "用户id")
    private Long userId;

    @ApiModelProperty(notes = "关联id")
    private Long relatedId;

    @ApiModelProperty(notes = "账单类别")
    private AccountBillType type;

    @ApiModelProperty(notes = "资金类型")
    private AccountFundType accountFundType;

    @ApiModelProperty(notes = "交易方式")
    private BillPayMethod billPayMethod;

    @ApiModelProperty(notes = "付款状态")
    private PayStatus payStatus;

    @ApiModelProperty(notes = "相关的memo.")
    private String memo;

    @ApiModelProperty(notes = "付款时间或者取消订单的时间")
    private LocalDateTime endTime;

    @ApiModelProperty(notes = "本次系统账户支付的钱或其他资金类型(+ -> 收入的钱（或批次等）, - -> 支付的钱（或批次等）)")
    private Long change;

    public static AccountDetail getInstance(Long userId, Long relatedId) {
        AccountDetail accountDetail = new AccountDetail();
        accountDetail.setUserId(userId);
        accountDetail.setRelatedId(relatedId);
        return accountDetail;
    }
}